package com.xy.biz.rs.domain.converter;

import java.util.Collection;
import java.util.List;

import com.xy.biz.rs.domain.req.UpdateManufactureRecordModifyApplyRequest;
import com.xy.tool.util.BeanUtilsEx;
import com.xy.biz.rs.domain.bo.ManufactureRecordModifyApplyBO;
import com.xy.biz.rs.domain.po.ManufactureRecordModifyApplyPO;
import com.xy.biz.rs.domain.query.ManufactureRecordModifyApplyQuery;
import com.xy.biz.rs.domain.resp.GetManufactureRecordModifyApplyResponse;
import com.xy.biz.rs.domain.req.SaveManufactureRecordModifyApplyRequest;
import com.xy.biz.rs.domain.req.ListManufactureRecordModifyApplyRequest;

/**
 *
 *
 * @author wwj
 * @date 2021-4-16
 */
public class ManufactureRecordModifyApplyConverter {

	public static ManufactureRecordModifyApplyPO toPO(ManufactureRecordModifyApplyBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new ManufactureRecordModifyApplyPO(), true);
	}

	public static List<ManufactureRecordModifyApplyPO> toPO(Collection<ManufactureRecordModifyApplyBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ManufactureRecordModifyApplyPO(), true);
	}

	public static ManufactureRecordModifyApplyBO fromPO(ManufactureRecordModifyApplyPO source) {
		return BeanUtilsEx.copyProperties(source, () -> new ManufactureRecordModifyApplyBO());
	}

	public static List<ManufactureRecordModifyApplyBO> fromPO(Collection<ManufactureRecordModifyApplyPO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ManufactureRecordModifyApplyBO());
	}


	public static ManufactureRecordModifyApplyBO toBO(SaveManufactureRecordModifyApplyRequest source) {
		return BeanUtilsEx.copyProperties(source, () -> new ManufactureRecordModifyApplyBO(), true);
	}

	public static ManufactureRecordModifyApplyBO toBO(UpdateManufactureRecordModifyApplyRequest source) {
		return BeanUtilsEx.copyProperties(source, () -> new ManufactureRecordModifyApplyBO(), true);
	}

	public static List<ManufactureRecordModifyApplyBO> toBO(Collection<SaveManufactureRecordModifyApplyRequest> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ManufactureRecordModifyApplyBO(), true);
	}

	public static GetManufactureRecordModifyApplyResponse toResponse(ManufactureRecordModifyApplyBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new GetManufactureRecordModifyApplyResponse());
	}

	public static List<GetManufactureRecordModifyApplyResponse> toResponse(Collection<ManufactureRecordModifyApplyBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new GetManufactureRecordModifyApplyResponse());
	}

	public static ManufactureRecordModifyApplyQuery toQuery(ListManufactureRecordModifyApplyRequest source) {
		if(null == source) {
			return null;
		}
		ManufactureRecordModifyApplyQuery target = new ManufactureRecordModifyApplyQuery(source.getPageIndex(), source.getPageSize());
		BeanUtilsEx.copyProperties(source, target);
		return target;
	}

}
